UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dYf/CVkiJz/GyESJOWb32GQix02meNjFnItrVqfIvu4=' 
WHERE 
  key_id = '33fa30b6815a895f591cf57855cda04f6352c5cb6c97db16aa54f0b289882df7' 
  AND (
    token = 'dYf/CVkiJz/GyESJOWb32GQix02meNjFnItrVqfIvu4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035