UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0jAKAe90Dbb1McGfbd05gk7G2/9hVVT7F22eYFZTETY='
WHERE
key_id = 'ebdb82d08a8d7eea5bf80ee54c7d67993e39a4811eeee6b6f6d1823024a0f2a7'
AND (
token = '0jAKAe90Dbb1McGfbd05gk7G2/9hVVT7F22eYFZTETY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)