UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2h3AascqM9McDcLxOvSd/7GxruS64elJBekhQi74n8Q=' 
WHERE 
  key_id = 'e774e6635013156ddd032309dbccc422ac830551a815d9f137a716877e6736c2' 
  AND (
    token = '2h3AascqM9McDcLxOvSd/7GxruS64elJBekhQi74n8Q=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034