UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WBqkj9N7JMAvqBywIq2RZYqANejNh2mI1zhtAccCWeo=' 
WHERE 
  key_id = '00710a26dcea31090fc6a4e03c624f7d525af7c04df91e75ee06a9f24c0b70cc' 
  AND (
    token = 'WBqkj9N7JMAvqBywIq2RZYqANejNh2mI1zhtAccCWeo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00093