UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BCj7T+8SqCW1/jehDbLVyXKvagpjnf/69ewR/8kDlJY='
WHERE
key_id = 'f0737b96a98e6f540d1072137ba85440c5085e23e8f6fe207c0b8e1e0dfbef1f'
AND (
token = 'BCj7T+8SqCW1/jehDbLVyXKvagpjnf/69ewR/8kDlJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)