UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n2dY7dDf9vn+SyHVE/KUqmP7/SQ5Y7rc95Im3h2vDKU='
WHERE
key_id = '0ee804a6444997518d174477c05c292e327995c285aa892757f2f1a5197b30bc'
AND (
token = 'n2dY7dDf9vn+SyHVE/KUqmP7/SQ5Y7rc95Im3h2vDKU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)