UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wjoBsig4tISyjbxe+8pnGtVC7xWwRubN5kMl73rzq9E=' 
WHERE 
  key_id = 'a4452bf029de9b6f8ce51ca2a7bbe98cc2eb17c48683e606e336ea95f17ba943' 
  AND (
    token = 'wjoBsig4tISyjbxe+8pnGtVC7xWwRubN5kMl73rzq9E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074