UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dLDBiqH129wUo9/WiTWeyCVLTJPxewUu85SLIhEGnOE=' 
WHERE 
  key_id = '5ab3ce8948ef0cea1a845c1759989037243249bccc66c6cc50fabf33fcc30280' 
  AND (
    token = 'dLDBiqH129wUo9/WiTWeyCVLTJPxewUu85SLIhEGnOE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021