UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1JEnAryS5oWJibYFgsOOpdk2WszM5OfGzJw2d6Sive0='
WHERE
key_id = '134f111b8ff50ec7754b2bd611fbea2315609b2987bb2563915e5ec238fc1c0f'
AND (
token = '1JEnAryS5oWJibYFgsOOpdk2WszM5OfGzJw2d6Sive0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)