UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ehfSSpHvFLiZdEzxp3v16rUw+WC5csqL0MU52MJpRj4=' 
WHERE 
  key_id = '77c35914b1610e04c1e49a03eb7ce38376f4f4d2611eb38a22d4a65d9185242d' 
  AND (
    token = 'ehfSSpHvFLiZdEzxp3v16rUw+WC5csqL0MU52MJpRj4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029