UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HkLA3QX1GfL682GuGO7BfcIaNDiXNAUR7kmFXFIEAL0='
WHERE
key_id = '4ef7a6ab2928749076d053009272f46290ae27d80b28593ea9cfbafc9646821b'
AND (
token = 'HkLA3QX1GfL682GuGO7BfcIaNDiXNAUR7kmFXFIEAL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)