UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Q1kujyJWUH2XsBjaz0hxebV9GKKZJL8fUQn+nyfQSmc=' 
WHERE 
  key_id = 'c0a976227b31516e59297f3e3e4ed4de983fdd46abfa3d55a3294b523df3287d' 
  AND (
    token = 'Q1kujyJWUH2XsBjaz0hxebV9GKKZJL8fUQn+nyfQSmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036