UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e/Dx88ZJcFGkoS07AjIIzVRyUzVdXGaLOpWWYx9pMls='
WHERE
key_id = '112338836c81a64436e483376ddbe7a6468a5959b0e25607ec80633de2beaccc'
AND (
token = 'e/Dx88ZJcFGkoS07AjIIzVRyUzVdXGaLOpWWYx9pMls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)