UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Bpoxwic+YRaeXozaZX1hbUUsFr1XSXum53sauIWXgTo=' 
WHERE 
  key_id = '2aca674bd85f4232f26909824ed9cc64b9e0918314d16ae58a78354b80903d01' 
  AND (
    token = 'Bpoxwic+YRaeXozaZX1hbUUsFr1XSXum53sauIWXgTo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015