UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A/vEllG3q39+5Ky2v9oVQ6v3rXa8W3WuIR39KK8sPNQ=' 
WHERE 
  key_id = 'd53dc821c3c504b0b03753a1b787fc0e9fbe22751b1eb5741863f32e41ecf39e' 
  AND (
    token = 'A/vEllG3q39+5Ky2v9oVQ6v3rXa8W3WuIR39KK8sPNQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042