UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IgoWDCLBa82y1+MZ3/eG7X1loBAHBAOFe1RbxNZ/gxU='
WHERE
key_id = 'c04c1d1490f9000bc521fac500f932fe3e83fe8dd0a5ee5658048b54c084d8f1'
AND (
token = 'IgoWDCLBa82y1+MZ3/eG7X1loBAHBAOFe1RbxNZ/gxU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)