UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/MEZRhA0UjAW1sm+yTJNO8D1Pjz8MDFzckEVSJ4cqJU=' 
WHERE 
  key_id = 'd2082edd8426f1819ded88623a401f7463889d3be75b193338b623c58caa5537' 
  AND (
    token = '/MEZRhA0UjAW1sm+yTJNO8D1Pjz8MDFzckEVSJ4cqJU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031