UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqI+Vp3i/p3onY8bCfckOYjyQilt9jABXSZSy/fsS9M='
WHERE
key_id = '7867b51c1573deccfbc6b6fdd9d13dec63555624882fea57516b66efb3ee6962'
AND (
token = 'eqI+Vp3i/p3onY8bCfckOYjyQilt9jABXSZSy/fsS9M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)