UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/6H1yG7uugq9BgNHjMe/yNHrWnR1GnwKsNxiubF609o=' 
WHERE 
  key_id = 'a1dd69494f2113c15465bf5a5cdef63405eb137555828651cc8d3f540729ce75' 
  AND (
    token = '/6H1yG7uugq9BgNHjMe/yNHrWnR1GnwKsNxiubF609o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056