UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 300,
token = 'jFLF5YWMnZdn6TTdG63zTjrcpI4liwva5SG+NSGWOLg='
WHERE
key_id = '30e8f865c90032b6cdccc360bc15dde35743805be47883b68b8e0808755fb9e2'
AND (
token = 'jFLF5YWMnZdn6TTdG63zTjrcpI4liwva5SG+NSGWOLg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)