UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0kkW7yMkNOwQaF+LndIOkbTLuM/svacozBdRRYkBWD0='
WHERE
key_id = '0c21625b88202ba2b605859cf1370f2157029b878849d0992200c8efcf220cbd'
AND (
token = '0kkW7yMkNOwQaF+LndIOkbTLuM/svacozBdRRYkBWD0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)