UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hBhgKF++iWHS08ZKk025ZhZvewd1+mvfpaZQdtKy00c=' 
WHERE 
  key_id = 'b0471a2a4b5101c2ba877f59d9645839d60eedd630b5cbc20e25d7500efeef78' 
  AND (
    token = 'hBhgKF++iWHS08ZKk025ZhZvewd1+mvfpaZQdtKy00c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026