UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yAP7NHHohsRfYwikzbylG0RRWkqEGyCIMf363yXRbHw=' 
WHERE 
  key_id = 'a70ef5fbccab9fa9fbac69c7805728e891faf653b9d9b5db4486eeaea5db91aa' 
  AND (
    token = 'yAP7NHHohsRfYwikzbylG0RRWkqEGyCIMf363yXRbHw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041