UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eAqaH3W84g9C0KwWTBNNQwi0k8vmuWH62y81S7/M1p4=' 
WHERE 
  key_id = '38ddc684cc153817c538c064cff33065b1f1d0ed4b2447b0e258538520dec835' 
  AND (
    token = 'eAqaH3W84g9C0KwWTBNNQwi0k8vmuWH62y81S7/M1p4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016