UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'InFNfyXIJi9GAPkhetRFoCHEPY+tuLbuHfh3AI3/M+8='
WHERE
key_id = '41ce77e539ef299e96478fa256c41f4702c1bf04d7345234fc09e6035e71c68f'
AND (
token = 'InFNfyXIJi9GAPkhetRFoCHEPY+tuLbuHfh3AI3/M+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)