UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DBP9g1DcHi1rELoxPNDIGujQwec/eFJ37j7ihaCT0OQ='
WHERE
key_id = 'aa0c97909dbaf7d5c350ff2eaf278084b04eb12b55b04dd711cde73810841f49'
AND (
token = 'DBP9g1DcHi1rELoxPNDIGujQwec/eFJ37j7ihaCT0OQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)