UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GTnZEZndjYPvmvZozxGiThmlYFB7Fff3qAFxRxFWakM=' 
WHERE 
  key_id = '4d2fbc6e25581868d75f7708aa8fcedd3e62a286e57dc1f9ca211a82475c3360' 
  AND (
    token = 'GTnZEZndjYPvmvZozxGiThmlYFB7Fff3qAFxRxFWakM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027