UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqN3uAgsXKfUM2aS5RknIXUWMxLWlChuS7fygIyUMmg='
WHERE
key_id = '900d690afba76ca8244edca0ce3359fc73e61d8736bfbb63e7a22bcd3d289051'
AND (
token = 'eqN3uAgsXKfUM2aS5RknIXUWMxLWlChuS7fygIyUMmg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)