UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '79ek/7/82LYzq8oyt+/ckdpV0DBCQVwEZa9kPFa0yMk=' 
WHERE 
  key_id = '577a3de964f707a417daf13f664d6287402c60701f2f8ecedef5e190cee4ae84' 
  AND (
    token = '79ek/7/82LYzq8oyt+/ckdpV0DBCQVwEZa9kPFa0yMk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039