UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mji5Nq5M9nXaZFMU52fQ6dHLkStWbs+LpOXL9z3gG+4='
WHERE
key_id = '2fe0e8ce709f37c8b9fd9238574cbde824e25afc37bb2582acda410b26df4253'
AND (
token = 'Mji5Nq5M9nXaZFMU52fQ6dHLkStWbs+LpOXL9z3gG+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)