UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jMnyZs995MZNpMk5n35e2IKz7OBCAtAGN5TmEQhPolA='
WHERE
key_id = '90ef505825e66727a864b7a555e6fd3072df787b714c216b756875a9d85bd8df'
AND (
token = 'jMnyZs995MZNpMk5n35e2IKz7OBCAtAGN5TmEQhPolA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)